s

What is Kubernetes | Kubernetes For Beginner edit button Edit

author
Murugan Andezuthu Dharmaratnam | calendar 12 August 2021 | 551

Originally developed by google, Kubernetes is an open-source container-orchestration system for automating computer application deployment, scaling, and management. Containerization has become a major trend in software development with more and more applications adopting microservice architecture. container orchestration tools like kubernetes where developed to manage large applications having hundreds or even thousands of containers and managing containers using scripts became complicated and sometimes impossible.

Orchestration tools like kubernetes offers the following features.

  1. High availability
  2. Scalability
  3. Disaster recovery

Architecture

KUBERNETES CLUSTER
	Node Pool
		Node
	MASTER NODE
		API Server
		Control Manager
		Scheduler
		etcd
	WORKER NODE
		Kublet
		Kubeproxy
		Docker
		Pod ( Self Contained Server ) 
			Deployment
			Stateful Set
		Services
		Ingress
	VIRTUAL NETWORK
	Config Map
	Secret
	Volumes



Kubernetes cluster is made up with at least 1 master node and couple of worker nodes. node is a physical or a virtual machine where you run your workloads on. with each node having a kublet process running on it. Kublet is a process that makes it possible for for the cluster to communicate with each other and execute tasks on those node. each worker node has docker containers running on it.

Master runs several kubernetes processes.

  1. API Server: API server is the gateway to the Kubernetes cluster.
  2. controller manager: keeps track of what's happening in the cluster.
  3. Sheduler: is responsible for scheduling containers on different nodes based on work work load and available server resources available on each node.
  4. etcd: key value storage stores the current state of the kubernetes cluster. its a key value pair.

A node pool is a group of nodes within a cluster that all have the same configuration

POD: is the smallet unit which a user will configure and interact with. is an abstraction over the container. It creates a layer on top of the container. It wants to abstract the container technologies, so that you do not want to work with docker. pod is ment to run only one application. each pod gets its own ip address.When a pod dies a new pod is created and it gets a new ip address. a virtual network assigns an ip address to each pod. Pod is its own self contained server. When you scale you increase the number of pods. To create a pod you send a request to configure a component for deployment

SERVICES: basically is a subsitute of ip addresses. services sits in front of each pode that talks to each other. If a pod dies the service stays in place . Two Main functionality. Permanent IP Address & It is also a load balencer. Service: is a static ip address that can be attached to each pod. even if the pod dies the service will start. Service is also a load balencer. External Service: external service is a servcie that opens the communication from external sources. external application can communicate with the service using the node ip address and port number if you want to quickly test something.

Ingress: If you want to point your domain to an application you create an ingress. The request first goes to the Ingress

config map: is an external configuation to your applicaiton. will contain configuration data like url of the database. you connect config map to the pod so config map get the data the config map contains.

secret : is just like config map. but its used to store secret data like connection string. and its stored in encoded format.

volumes: used to persist data. its a physical storage like a harddrive attached to the pod. its not a part of kubernetest cluster. kubernetest cluster does not expecitly manage data persitance.

replication: for high availability pods are replicated in other nodes.

Deployment: you create a blueprint for a pod and thats blueprint is called deployment and specify the number of replicas you would like to run. in practice you will not be creating pods, you will be creating deployments. you scale up or scale down number of replicas of the pod. deployment is another layer of abstraction on top of pods.

statefulset : ment of applications like database. you cant replicate database though deployment. database should be created tough stefulsets